home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / misc / multicolpar.sty (.txt) < prev    next >
LaTeX Document  |  1993-01-11  |  3KB  |  60 lines

  1. %% Save file as: MULTICOLPAR.STY        Source: FILESERV@SHSU.BITNET  
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. %  File multicolpar.sty
  4. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  5. % Mauro Orlandini <orlandini@lheavx.gsfc.nasa.gov>
  6. % Modified by Max Hailperin <max@nic.gac.edu>
  7. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  8. %   This LaTeX style, writes different paragraphs in different columns
  9. % the number of columns is free), as
  10. %   This is the first paragraph  |  This is the second paragraph and its
  11. %   and text follows...          |  own text follows...
  12. %   This is the third paragraph  |  This is the fourth paragraph...
  13. %   and text follows...          |
  14. % This format is useful for translated articles, in which there is the
  15. % original language in the first column and the translated version in
  16. % the second.
  17. % Usage: \begin{multicolpar}{N}
  18. %         ... text ...
  19. %        \end{multicolpar}
  20. % where N is the number of columns in which the text will be displayed.
  21. % Warning: Inside the environment, each blank line (ie a \par) will correspond
  22. %          to a paragraph, therefore do not leave blank lines soon after the
  23. %          \begin{multicolpar}{N} command and soon before the \end{multicolpar}
  24. %          command (unless you want so).
  25. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  26. \newenvironment{multicolpar}[1]{\begin{trivlist}\item[]%
  27. \multicolumnparallelparagraphs{#1}{2em}}%
  28. {\endmulticolumnparallelparagraphs\end{trivlist}}
  29. \newcount\columnsleft   \newcount\totalcolumns   \newdimen\separation
  30. \def\multicolumnparallelparagraphs#1#2{%
  31.     \hbadness5000 \vbadness9999 \tolerance9999
  32.     \totalcolumns=#1   \separation=#2   \let\xpar=\par
  33.     \vskip\parskip
  34.     \columnsleft=#1\relax
  35.     \hbox to\hsize\bgroup
  36.     \let\par\nextmulticolumnparallelparagraph
  37.     \dimen0=#2\advance\hsize-\columnsleft\dimen0 \advance\hsize\dimen0
  38.     \divide\hsize\columnsleft\relax
  39.     \vtop\bgroup}
  40. \def\nextmulticolumnparallelparagraph{%
  41.     \egroup
  42.     \advance\columnsleft-1
  43.     \ifnum\columnsleft>0
  44.         \hfil\vtop\bgroup
  45.     \else
  46.     \egroup
  47.         \xpar\vskip\baselineskip\xpar
  48.         \multicolumnparallelparagraphs\totalcolumns\separation
  49.     \fi}
  50. \def\endmulticolumnparallelparagraphs{%
  51.     \egroup
  52.     \advance\columnsleft-1
  53.     \ifnum\columnsleft>0
  54.         \hfil\vtop\bgroup\hbox to \hsize{}
  55.         \endmulticolumnparallelparagraphs
  56.     \else
  57.     \egroup
  58.         \xpar
  59.     \fi}
  60.